package com.opensource.component.redis.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author ZL since on 2021/2/17 下午3:23
 */
@Slf4j
@EnableConfigurationProperties(RedisProperties.class)
@ConditionalOnProperty(name = "com.opensource.component.redis.enable", havingValue = "true")
public class RedisAutoConfiguration {
    @Bean
    public RedisTemplate<String, Object> redisTemplate(){
        return new RedisTemplate<>();
    }
}
